<!-- 已登录, 显示操作菜单 -->
<% if signed_in? %>
<ul class="nav navbar-nav navbar-right navbar-footer drop-nav" >
  <!-- 后台操作 -->
  <% if current_user.admin? %>
  <li>
    <%= link_to content_tag(:i, '', class: 'glyphicon glyphicon-console header-console'), main_app.admin_index_path, title: t('console') %>
  </li>
  <% end %>

  <!-- 消息通知 -->
  <li>
    <%= content_tag :a, href: notifications_path do -%>
      <% notify_count = Notification.unread_count(current_user) %>
      <%= content_tag :id, '', class: 'fa fa-bell', style: "#{ 'color: #eb592c;' if notify_count > 0 }" %>
      <%= content_tag(:span, notify_count, class: 'badge', style: 'background: #eb592c') if notify_count > 0 %>
    <% end -%>
  </li>

  <!-- 新建类操作 -->
  <li class="dropdown dropdown-opt">
    <a class="dropdown-toggle" data-toggle="dropdown" role="button" >
      <span class="glyphicon glyphicon-plus"></span>
      <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <%= content_tag :li, link_to(t("new_blog"), main_app.new_article_path) %>
      <%= content_tag :li, link_to(t("edit_resume"), main_app.resume_edit_user_path(current_user.username)) %>
    </ul>
  </li>
  <!-- 设置类操作 -->
  <li class="dropdown dropdown-setting">
    <a class="dropdown-toggle" data-toggle="dropdown" role="button" >
      <!-- 头像 -->
      <%= avatar_tag current_user, :xs %>
      <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <%= content_tag :li, link_to(capitalize_name(current_user), main_app.user_path(current_user.username)) %>
      <%= content_tag :li, content_tag(:div, '', class:"divider") %>
      <%= content_tag :li, link_to(t("account_profile"), main_app.edit_account_path) %>
      <%= content_tag :li, link_to(t("resume"), main_app.resume_user_path(current_user.username)) %>
      <%= content_tag :li, link_to(t("drafts"), main_app.drafts_user_path(current_user.username)) %>
      <%= content_tag :li, content_tag(:div, '', class:"divider") %>
      <%= content_tag :li, link_to(t("signout"), main_app.signout_path, method: 'delete') %>
    </ul>
  </li>
</ul>
<% else %>
<!-- 登录注册 -->
<div class="navbar-right navbar-footer login-group">
  <%= link_to t("signup"), main_app.signup_path, class: "navbar-text" %>
  <%= link_to t("signin"), main_app.signin_path, class: "navbar-text" %>
</div>
<% end %>